package com.trkj.aspect;

import javafx.animation.KeyValue;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

@Slf4j
public class Syslog {
    public void before(JoinPoint joinpoint){
        log.debug("{} {}", joinpoint.getTarget().getClass().getName(), joinpoint.getSignature().getName());
        log.debug("前置通知正在执行");
    }
    public void after(JoinPoint joinPoint){
        log.debug("{} {}", joinPoint.getTarget().getClass().getName(), joinPoint.getSignature().getName());
        log.debug("最终后置通知正在执行");
    }
    public void afterReturning(JoinPoint joinPoint){
        log.debug("{} {}", joinPoint.getTarget().getClass().getName(), joinPoint.getSignature().getName());
        log.debug("后置通知正在执行");
    }
    public int around(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        log.debug("{} {}", proceedingJoinPoint.getTarget().getClass().getName(), proceedingJoinPoint.getSignature().getName());
        log.debug("环绕通知正在执行");
        int res= (int) proceedingJoinPoint.proceed();
        return res;
    }
}
